<template>
  <div class="fiexd__input">
    <div class="fiexd__left">
      <el-button text><icon-pepicons-pop-paperclip /></el-button>
      <el-button text><icon-akar-icons-link-chain /></el-button>
      <el-button text><icon-akar-icons-link-chain /></el-button>
    </div>
    <el-input placeholder="在这里输入你的消息..." v-model="text" />
    <div class="fiexd__right">
      <el-button text class="emoticon">
        <icon-emojione-smiling-face-with-sunglasses @click="showEmoticon" />
        <Emoticon :is-one="true" v-show="emoticon" :icons="(emoticonJson as Array<string>)" />
      </el-button>
      <el-button type="primary"><icon-lucide-send-horizonal /></el-button>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { ElButton } from 'element-plus';
import Emoticon from './emoticons.vue'
//@ts-ignore
import emoticonJson from '@/assets/emoticon.json'


const text = ref("")
const emoticon = ref(false)
/**
 * 显示感情符号
 */
function showEmoticon() {
  emoticon.value = !emoticon.value


}

</script>


<style lang="scss" scoped>
.fiexd__input {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 93%;
  background-color: white;
  display: flex;
  gap: 6px;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 4px 10px;

  :deep(.el-input) {
    flex: 1;
    border: none;
    font-size: 20px;

    .el-input__wrapper {
      box-shadow: none;
    }
  }

  :deep(.el-input__inner) {
    border: 0;
  }

  .fiexd__left {
    display: flex;
    gap: 4px;

    :deep(.el-button) {
      width: max-content;
      padding: 0px 3px;
    }
  }

  .fiexd__right {
    display: flex;
    position: relative;

    >.emoticon {
      position: relative;

    }
  }
}
</style>